/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * main.java
 *
 * Created on Jul 10, 2011, 10:01:58 AM
 */
package com.viweb.storemanager.ui;

import com.viweb.storemanager.report.DailyReportPnl;
import com.viweb.storemanager.common.ImagePanel;
import com.viweb.storemanager.common.AppStatusBar;
import com.viweb.storemanager.common.ButtonBarFactory;
import com.jgoodies.looks.HeaderStyle;
import com.jgoodies.looks.Options;
import com.viweb.storemanager.entity.Employee;
import com.viweb.storemanager.ui.database.BackupDlg;
import com.viweb.storemanager.ui.database.RestoreDlg;
import java.net.URL;
import javax.help.CSH;
import javax.help.HelpBroker;
import javax.help.HelpSet;
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
import com.jgoodies.looks.plastic.PlasticXPLookAndFeel;
import com.jgoodies.looks.plastic.theme.ExperienceBlue;
import com.l2fprod.common.swing.JButtonBar;
import com.viweb.storemanager.core.CursorManager;
import com.viweb.storemanager.entity.AppConfig;
import com.viweb.storemanager.entity.ConfigManager;
import com.viweb.storemanager.report.DailyReportByUserPnl;
import com.viweb.storemanager.report.PeriodReportPnl;
//import com.viweb.storemanager.report.ReportPnl;
import com.viweb.storemanager.report.ReportPnl;
import com.viweb.storemanager.ui.config.ConfigDlg;
import com.viweb.storemanager.ui.customer.CustomerPnl;
import com.viweb.storemanager.ui.customer.CustomerTypesPnl;
import com.viweb.storemanager.ui.employee.EmployeePnl;
import com.viweb.storemanager.ui.product.ProductCatogoriesPnl;
import com.viweb.storemanager.ui.product.ProductPnl;
import com.viweb.storemanager.ui.product.ProductTypesPnl;
import com.viweb.storemanager.ui.sale.SaleinvoicePnl;
import com.viweb.storemanager.ui.shipping.ShipinvoicePnl;
import com.viweb.storemanager.ui.vendor.VendorPnl;
import com.viweb.storemanager.ui.warehouse.WarehouseImportExportPnl;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JToggleButton;
import javax.swing.UIManager;
import net.infonode.docking.RootWindow;
import net.infonode.docking.SplitWindow;
import net.infonode.docking.View;
import net.infonode.docking.properties.RootWindowProperties;
import net.infonode.docking.theme.DockingWindowsTheme;
import net.infonode.docking.theme.ShapedGradientDockingTheme;
import net.infonode.docking.util.DockingUtil;
import net.infonode.docking.util.PropertiesUtil;
import net.infonode.docking.util.ViewMap;

/**
 *
 * @author qhvic
 */
public class MainFrm extends javax.swing.JFrame {

    Employee emp = null;
    private String applicationTitle = "My Store Manager 1.0";
    public static AppConfig APP_CONFIG;
    /**
     * The one and only root window
     */
    private RootWindow rootWindow;
    private View[] views = new View[2];
    private ViewMap viewMap = new ViewMap();
    private DockingWindowsTheme currentTheme = new ShapedGradientDockingTheme();
    private RootWindowProperties properties = new RootWindowProperties();
    final RootWindowProperties titleBarStyleProperties = PropertiesUtil.createTitleBarStyleRootWindowProperties();
    private JToggleButton btnCustomer, btnBaocao, btnProduct, btnWareHouse, btnNhapHang, btnXuatHang, btnAbout;
    private AppStatusBar statusBar;
    private MyCafePnl mainPanel;

    /** Creates new form main */
    public MainFrm() {
        APP_CONFIG = new ConfigManager().readConfig();
        initComponents();
        emp = new Employee();
        this.extraInitComponents();
        this.setLoginState(false);
        this.menuBar.putClientProperty(Options.HEADER_STYLE_KEY, HeaderStyle.SINGLE);
        this.menuBar.putClientProperty(PlasticLookAndFeel.IS_3D_KEY, Boolean.FALSE);

        //them help vao ung dung
        HelpSet hs = getHelpSet("com/viweb/storemanager/myhelp/sample.hs");
        HelpBroker hb = hs.createHelpBroker();
        CSH.setHelpIDString(mniHelp, "top");
        mniHelp.addActionListener(new CSH.DisplayHelpFromSource(hb));

    }

    public HelpSet getHelpSet(String helpsetfile) {
        HelpSet hs = null;
        ClassLoader cl = this.getClass().getClassLoader();
        try {
            URL hsURL = HelpSet.findHelpSet(cl, helpsetfile);
            hs = new HelpSet(null, hsURL);
        } catch (Exception ee) {
            JOptionPane.showMessageDialog(this, "HelpSet: " + helpsetfile + " not found", "Help File", JOptionPane.ERROR_MESSAGE);
        }
        return hs;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        pnlLeft = new javax.swing.JPanel();
        pnlButtonBar = new javax.swing.JPanel();
        btnQuickAccessTitle = new com.jidesoft.swing.JideButton();
        pnlRight = new javax.swing.JPanel();
        pnlDualPane = new javax.swing.JPanel();
        pnlMainPane = new javax.swing.JPanel();
        pnlSecondPane = new javax.swing.JPanel();
        mniMonthlyReport = new javax.swing.JMenuItem();
        pnlBanner =  createBannerPanel();
        pnlCenter = new javax.swing.JPanel();
        pnlStatus = new javax.swing.JPanel();
        menuBar = new javax.swing.JMenuBar();
        mnSystem = new javax.swing.JMenu();
        mniLogin = new javax.swing.JMenuItem();
        mniLogout = new javax.swing.JMenuItem();
        mniConfig = new javax.swing.JMenuItem();
        mniChangePwd = new javax.swing.JMenuItem();
        sep1 = new javax.swing.JPopupMenu.Separator();
        mniBackup = new javax.swing.JMenuItem();
        mniRestore = new javax.swing.JMenuItem();
        sep2 = new javax.swing.JPopupMenu.Separator();
        mniExit = new javax.swing.JMenuItem();
        mnNghiepVu = new javax.swing.JMenu();
        mniNghanhHang = new javax.swing.JMenuItem();
        mniLoaiMatHang = new javax.swing.JMenuItem();
        mniMatHang = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mniLoaiKhachHang = new javax.swing.JMenuItem();
        mniQLKhachHang = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        mniQLNhanVien = new javax.swing.JMenuItem();
        mniQLNhaCungCap = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        mniQLKho = new javax.swing.JMenuItem();
        mnReport = new javax.swing.JMenu();
        mniDailyReport = new javax.swing.JMenuItem();
        mniPeriodReport = new javax.swing.JMenuItem();
        jMenuItem1 = new javax.swing.JMenuItem();
        mnuEmployeeList = new javax.swing.JMenuItem();
        mnuCustomerList = new javax.swing.JMenuItem();
        mnuProductList = new javax.swing.JMenuItem();
        mnuTypeList = new javax.swing.JMenuItem();
        mnuVendorList = new javax.swing.JMenuItem();
        mnTool = new javax.swing.JMenu();
        mniSearch = new javax.swing.JMenuItem();
        mnHelp = new javax.swing.JMenu();
        mniHelp = new javax.swing.JMenuItem();
        mniAbout = new javax.swing.JMenuItem();

        pnlLeft.setLayout(new java.awt.GridBagLayout());

        pnlButtonBar.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        pnlLeft.add(pnlButtonBar, gridBagConstraints);

        btnQuickAccessTitle.setText("Truy cập nhanh");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        pnlLeft.add(btnQuickAccessTitle, gridBagConstraints);

        pnlRight.setLayout(new java.awt.BorderLayout());

        pnlDualPane.setLayout(new java.awt.GridBagLayout());

        pnlMainPane.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.7;
        pnlDualPane.add(pnlMainPane, gridBagConstraints);

        pnlSecondPane.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 0.2;
        pnlDualPane.add(pnlSecondPane, gridBagConstraints);

        mniMonthlyReport.setText("jMenuItem1");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Store Mange v1.0");
        setMinimumSize(new java.awt.Dimension(6, 0));
        getContentPane().setLayout(new java.awt.GridBagLayout());

        pnlBanner.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 3);
        getContentPane().add(pnlBanner, gridBagConstraints);

        pnlCenter.setPreferredSize(new java.awt.Dimension(0, 0));
        pnlCenter.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        getContentPane().add(pnlCenter, gridBagConstraints);

        pnlStatus.setLayout(new java.awt.BorderLayout());
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        getContentPane().add(pnlStatus, gridBagConstraints);

        mnSystem.setText("Hệ thống");

        mniLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/login.png"))); // NOI18N
        mniLogin.setText("Đăng nhập...");
        mniLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniLoginActionPerformed(evt);
            }
        });
        mnSystem.add(mniLogin);

        mniLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/logout.png"))); // NOI18N
        mniLogout.setText("Hủy đăng nhập");
        mniLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniLogoutActionPerformed(evt);
            }
        });
        mnSystem.add(mniLogout);

        mniConfig.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/config.png"))); // NOI18N
        mniConfig.setText("Thiết lập...");
        mniConfig.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniConfigActionPerformed(evt);
            }
        });
        mnSystem.add(mniConfig);

        mniChangePwd.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/change_password.png"))); // NOI18N
        mniChangePwd.setText("Đổi mật khẩu...");
        mniChangePwd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniChangePwdActionPerformed(evt);
            }
        });
        mnSystem.add(mniChangePwd);
        mnSystem.add(sep1);

        mniBackup.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/export.png"))); // NOI18N
        mniBackup.setText("Sao lưu dữ liệu...");
        mniBackup.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniBackupActionPerformed(evt);
            }
        });
        mnSystem.add(mniBackup);

        mniRestore.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/import.png"))); // NOI18N
        mniRestore.setText("Phục hồi dữ liệu...");
        mniRestore.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniRestoreActionPerformed(evt);
            }
        });
        mnSystem.add(mniRestore);
        mnSystem.add(sep2);

        mniExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/exit.png"))); // NOI18N
        mniExit.setText("Thoát");
        mniExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniExitActionPerformed(evt);
            }
        });
        mnSystem.add(mniExit);

        menuBar.add(mnSystem);

        mnNghiepVu.setText("Nghiệp vụ");

        mniNghanhHang.setText("Nghành hàng");
        mniNghanhHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniNghanhHangActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniNghanhHang);

        mniLoaiMatHang.setText("Loại mặt hàng");
        mniLoaiMatHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniLoaiMatHangActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniLoaiMatHang);

        mniMatHang.setText("Mặt hàng");
        mniMatHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniMatHangActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniMatHang);
        mnNghiepVu.add(jSeparator1);

        mniLoaiKhachHang.setText("Loại khách hàng");
        mniLoaiKhachHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniLoaiKhachHangActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniLoaiKhachHang);

        mniQLKhachHang.setText("Quản lý khách hàng");
        mniQLKhachHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniQLKhachHangActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniQLKhachHang);
        mnNghiepVu.add(jSeparator3);

        mniQLNhanVien.setText("Quản lý nhân viên");
        mniQLNhanVien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniQLNhanVienActionPerformed1(evt);
            }
        });
        mnNghiepVu.add(mniQLNhanVien);

        mniQLNhaCungCap.setText("Quản lý nhà cung cấp");
        mniQLNhaCungCap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniQLNhaCungCapActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniQLNhaCungCap);
        mnNghiepVu.add(jSeparator2);

        mniQLKho.setText("Quản lý kho");
        mniQLKho.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniQLKhoActionPerformed(evt);
            }
        });
        mnNghiepVu.add(mniQLKho);

        menuBar.add(mnNghiepVu);

        mnReport.setText("Thống kê");

        mniDailyReport.setText("Thống kê theo ngày");
        mniDailyReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniDailyReportActionPerformed(evt);
            }
        });
        mnReport.add(mniDailyReport);

        mniPeriodReport.setText("Thống kê theo thời gian");
        mniPeriodReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniPeriodReportActionPerformed(evt);
            }
        });
        mnReport.add(mniPeriodReport);

        jMenuItem1.setText("Thống kê theo nhân viên");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        mnReport.add(jMenuItem1);

        mnuEmployeeList.setText("Danh sách nhân viên");
        mnuEmployeeList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuEmployeeListActionPerformed(evt);
            }
        });
        mnReport.add(mnuEmployeeList);

        mnuCustomerList.setText("Danh sách khách hàng");
        mnuCustomerList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuCustomerListActionPerformed(evt);
            }
        });
        mnReport.add(mnuCustomerList);

        mnuProductList.setText("Danh sách sản phẩm");
        mnuProductList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuProductListActionPerformed(evt);
            }
        });
        mnReport.add(mnuProductList);

        mnuTypeList.setText("Danh sách loại sản phẩm");
        mnuTypeList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuTypeListActionPerformed(evt);
            }
        });
        mnReport.add(mnuTypeList);

        mnuVendorList.setText("Danh sách các nhà cung cấp");
        mnuVendorList.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnuVendorListActionPerformed(evt);
            }
        });
        mnReport.add(mnuVendorList);

        menuBar.add(mnReport);

        mnTool.setText("Công cụ");

        mniSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/search.png"))); // NOI18N
        mniSearch.setText("Tìm kiếm");
        mnTool.add(mniSearch);

        menuBar.add(mnTool);

        mnHelp.setText("Trợ giúp");

        mniHelp.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/help.png"))); // NOI18N
        mniHelp.setText("Trợ giúp");
        mniHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniHelpActionPerformed(evt);
            }
        });
        mnHelp.add(mniHelp);

        mniAbout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/information.png"))); // NOI18N
        mniAbout.setText("Thông tin...");
        mniAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mniAboutActionPerformed(evt);
            }
        });
        mnHelp.add(mniAbout);

        menuBar.add(mnHelp);

        setJMenuBar(menuBar);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void mniLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniLoginActionPerformed
        // TODO add your handling code here:
        logIn();
    }//GEN-LAST:event_mniLoginActionPerformed

    private void mniHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniHelpActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_mniHelpActionPerformed

    private void mniChangePwdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniChangePwdActionPerformed
        // TODO add your handling code here:
        //user.setUserName(APP_CONFIG.getUserConfig().getUserName());
        //user.setID(APP_CONFIG.getUserConfig().getUserID());
        ChangePasswordDlg dialog = new ChangePasswordDlg(emp, this, true);
        // Centering the dialog
        Dimension d = dialog.getSize();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        dialog.setBounds(
                (int) (0.5 * (screenSize.width - d.getWidth())),
                (int) (0.5 * (screenSize.height - d.getHeight())),
                d.width, d.height);
        dialog.setVisible(true);
    }//GEN-LAST:event_mniChangePwdActionPerformed

    private void mniBackupActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniBackupActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Sao lưu dữ liệu");
        BackupDlg dialog = new BackupDlg(JOptionPane.getFrameForComponent(this), true);
        dialog.setLocationRelativeTo(this);
        dialog.setVisible(true);
        this.setTitle(this.applicationTitle);
    }//GEN-LAST:event_mniBackupActionPerformed

    private void mniRestoreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniRestoreActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Phục hồi dữ liệu");
        RestoreDlg dialog = new RestoreDlg(JOptionPane.getFrameForComponent(this), true);
        dialog.setLocationRelativeTo(this);
        dialog.setVisible(true);
        this.setTitle(this.applicationTitle);
    }//GEN-LAST:event_mniRestoreActionPerformed

    private void mniExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniExitActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_mniExitActionPerformed

    private void mniAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniAboutActionPerformed
        // TODO add your handling code here:
        AboutDlg aboutDlg = new AboutDlg(this, true);
        aboutDlg.setSize(425, 337);
        aboutDlg.setLocationRelativeTo(this);
        aboutDlg.setVisible(true);
    }//GEN-LAST:event_mniAboutActionPerformed

    private void mniDailyReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniDailyReportActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Báo cáo ngày");
        DailyReportPnl dailyReportPnl = new DailyReportPnl();
        this.pnlRight.removeAll();
        this.pnlRight.add(dailyReportPnl);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniDailyReportActionPerformed

    private void mniQLNhanVienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniQLNhanVienActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Nhân viên");

        this.pnlMainPane.removeAll();
        EmployeePnl empPnl = new EmployeePnl();
        this.pnlMainPane.add(empPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(empPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniQLNhanVienActionPerformed

    private void mniQLKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniQLKhachHangActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Khách hàng");

        this.pnlMainPane.removeAll();
        CustomerPnl customerPnl = new CustomerPnl();
        this.pnlMainPane.add(customerPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(customerPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniQLKhachHangActionPerformed

    private void mniQLNhaCungCapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniQLNhaCungCapActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Nhà cung cấp");

        this.pnlMainPane.removeAll();
        VendorPnl vendorPnl = new VendorPnl();
        this.pnlMainPane.add(vendorPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(vendorPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniQLNhaCungCapActionPerformed

    private void mniMatHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniMatHangActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Mặt hàng");

        this.pnlMainPane.removeAll();
        ProductPnl productPnl = new ProductPnl();
        this.pnlMainPane.add(productPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(productPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniMatHangActionPerformed

    private void mniLoaiMatHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniLoaiMatHangActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Loại mặt hàng");

        this.pnlMainPane.removeAll();
        ProductCatogoriesPnl productCatogoriesPnl = new ProductCatogoriesPnl();
        this.pnlMainPane.add(productCatogoriesPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(productCatogoriesPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniLoaiMatHangActionPerformed

    private void mniNghanhHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniNghanhHangActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Nghành hàng");

        this.pnlMainPane.removeAll();
        ProductTypesPnl productTypesPnl = new ProductTypesPnl();
        this.pnlMainPane.add(productTypesPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(productTypesPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniNghanhHangActionPerformed

    private void mniLoaiKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniLoaiKhachHangActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Loại khách hàng");

        this.pnlMainPane.removeAll();
        CustomerTypesPnl customerTypesPnl = new CustomerTypesPnl();
        this.pnlMainPane.add(customerTypesPnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(customerTypesPnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniLoaiKhachHangActionPerformed

    private void mniPeriodReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniPeriodReportActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Báo cáo theo thời gian");
        PeriodReportPnl periodReportPnl = new PeriodReportPnl();
        this.pnlRight.removeAll();
        this.pnlRight.add(periodReportPnl);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniPeriodReportActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Báo cáo theo thu ngân");
        DailyReportByUserPnl dailyReportByUserPnl = new DailyReportByUserPnl();
        this.pnlRight.removeAll();
        this.pnlRight.add(dailyReportByUserPnl);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void mniLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniLogoutActionPerformed
        // TODO add your handling code here:
        this.backToHomeScreen();
        this.mainPanel.setEnable(false);
        this.statusBar.setCurrentUsername("");

        this.setLoginState(false);
        this.logIn();
    }//GEN-LAST:event_mniLogoutActionPerformed

    private void mniQLKhoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniQLKhoActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Quản lý kho");
        WarehouseImportExportPnl warehouseImportExportPnl = new WarehouseImportExportPnl();
        this.pnlRight.removeAll();
        this.pnlRight.add(warehouseImportExportPnl);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniQLKhoActionPerformed

    private void mniQLNhanVienActionPerformed1(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniQLNhanVienActionPerformed1
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Loại khách hàng");

        this.pnlMainPane.removeAll();
        EmployeePnl employeePnl = new EmployeePnl();
        this.pnlMainPane.add(employeePnl);
        this.pnlMainPane.updateUI();

        this.pnlSecondPane.removeAll();
        this.pnlSecondPane.add(employeePnl.getCreationPanel());
        this.pnlSecondPane.updateUI();

        this.pnlRight.removeAll();
        this.pnlRight.add(this.pnlDualPane);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mniQLNhanVienActionPerformed1

    private void mnuEmployeeListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuEmployeeListActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Danh sách nhân viên");

        ReportPnl report = new ReportPnl(3, this.pnlRight, this);
        this.pnlRight.removeAll();
        this.pnlRight.add(report);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mnuEmployeeListActionPerformed

    private void mnuCustomerListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuCustomerListActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Danh sách khách hàng");

        ReportPnl report = new ReportPnl(1, this.pnlRight, this);
        this.pnlRight.removeAll();
        this.pnlRight.add(report);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mnuCustomerListActionPerformed

    private void mnuProductListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuProductListActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Danh sách sản phẩm");

        ReportPnl report = new ReportPnl(5, this.pnlRight, this);
        this.pnlRight.removeAll();
        this.pnlRight.add(report);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mnuProductListActionPerformed

    private void mnuTypeListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuTypeListActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Danh sách loại sản phẩm");

        ReportPnl report = new ReportPnl(4, this.pnlRight, this);
        this.pnlRight.removeAll();
        this.pnlRight.add(report);
        this.pnlRight.updateUI();

    }//GEN-LAST:event_mnuTypeListActionPerformed

    private void mnuVendorListActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuVendorListActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Danh sách nhà cung cấp");

        ReportPnl report = new ReportPnl(2, this.pnlRight, this);
        this.pnlRight.removeAll();
        this.pnlRight.add(report);
        this.pnlRight.updateUI();
    }//GEN-LAST:event_mnuVendorListActionPerformed

    private void mniConfigActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mniConfigActionPerformed
        // TODO add your handling code here:
        this.setCustomApplicationTitle("Thiết lập thông tin");
        ConfigDlg dialog = new ConfigDlg(JOptionPane.getFrameForComponent(this), true);
        dialog.setSize(500, 400);
        Dimension d = dialog.getSize();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        dialog.setBounds(
                (int) (0.5 * (screenSize.width - d.getWidth())),
                (int) (0.5 * (screenSize.height - d.getHeight())),
                d.width, d.height);
        dialog.setLocationRelativeTo(this);
        dialog.setVisible(true);
        this.setTitle(this.applicationTitle);
    }//GEN-LAST:event_mniConfigActionPerformed

    public void setCustomApplicationTitle(String extraTitle) {
        this.setTitle(this.applicationTitle + " - " + extraTitle);
    }

    public void updateUI() {
    }

    void logIn() {
        LoginDlg dialog = new LoginDlg(emp, this, true);
        // Centering the dialog
        Dimension d = dialog.getSize();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        dialog.setBounds(
                (int) (0.5 * (screenSize.width - d.getWidth())),
                (int) (0.5 * (screenSize.height - d.getHeight())),
                d.width, d.height);
        dialog.setVisible(true);

        if (!dialog.isCancel()) {
            this.mainPanel.setEnable(true);
            this.statusBar.setCurrentUsername(emp.getUsername());
//
//            // Ghi lại thông tin cấu hình phiên đăng nhập hiện tại
//            APP_CONFIG.getUserConfig().setUserID(user.getID());
//            APP_CONFIG.getUserConfig().setUserName(user.getUserName());
//            new ConfigManager().writeConfig(APP_CONFIG);
            // Cập nhật giao diện
            this.setLoginState(true);
        }
    }

    public void setLoginState(boolean state) {
//        this.mniLogin.setVisible(!state);
//        this.mniLogout.setVisible(state);
//
//        // this.mniConfig.setVisible(state);
//        this.mniChangePwd.setVisible(state);
//        this.mniBackup.setVisible(state);
//        this.mniRestore.setVisible(state);
//
//        this.mnNghiepVu.setVisible(state);
//        this.sep1.setVisible(state);
//        this.mnReport.setVisible(state);
//        this.mnTool.setVisible(state);
//
//        btnXuatHang.setVisible(state);
//        btnNhapHang.setVisible(state);
//        btnWareHouse.setVisible(state);
//        btnProduct.setVisible(state);
//        btnCustomer.setVisible(state);
//        btnBaocao.setVisible(state);
//        this.mni.setEnabled(state);
//        this.mniDrinkType.setEnabled(state);
//        this.mniTable.setEnabled(state);
//        this.mniMyCafe.setEnabled(state);
//        this.mniStock.setEnabled(false);
//        this.mniUserDailyReport.setVisible(state);
//
//        this.mniDailyReport.setEnabled(state);
//        this.mniPeriodReport.setEnabled(state);
//        this.mniMonthlyReport.setEnabled(state);
//        this.mnReportByUser.setEnabled(state);
//        this.mniUserDailyReport.setEnabled(state);
//        this.mniUserWeeklyReport.setEnabled(false);
//        this.mniUserMonthlyReport.setEnabled(false);
//
//        this.btnMenu.setEnabled(state);
//        this.btnMyCafe.setEnabled(state);
        // Hiển thị các chức năng báo cáo cho admin
//        if (state && APP_CONFIG.getUserConfig().getUserName().equals("administrator")) {
//            this.mnReport.setVisible(true);
//            this.sepUserDailyReport.setVisible(false);
//            this.mniUserDailyReport.setVisible(false);
//        } else {
//            this.mnReport.setVisible(false);
//            this.sepUserDailyReport.setVisible(true);
//            this.mniUserDailyReport.setVisible(true);
//        }
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                try {
                    // JGoodies Look and Feel
                    PlasticLookAndFeel laf = new PlasticXPLookAndFeel();
                    PlasticLookAndFeel.setPlasticTheme(new ExperienceBlue());
                    UIManager.setLookAndFeel(laf);
                    // Thay doi style cho TabbedPane
                    UIManager.put("TabbedPaneUI", "com.jidesoft.plaf.JideTabbedPaneUI");
                    UIManager.getDefaults().put("ComboBox.disabledForeground", Color.BLACK);
                    // Thay doi style cho ProgressBar
                    UIManager.put("ProgressBarUI", "com.viweb.storemanager.core.KumarProgressBarUI");
                    // Thay doi style cho ScrollBar
                    UIManager.put("ScrollBar.thumb", new Color(228, 217, 150));
                    UIManager.put("ScrollBar.thumbShadow", new Color(102, 97, 75));
                } catch (Exception ex) {
                    System.out.print("Error!");
                }
            }
        });
        MainFrm mainFrame = new MainFrm();
        mainFrame.setSize(new Dimension(800, 600));
        mainFrame.setExtendedState(mainFrame.getExtendedState() | javax.swing.JFrame.MAXIMIZED_BOTH);
        mainFrame.setVisible(true);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private com.jidesoft.swing.JideButton btnQuickAccessTitle;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenu mnHelp;
    private javax.swing.JMenu mnNghiepVu;
    private javax.swing.JMenu mnReport;
    private javax.swing.JMenu mnSystem;
    private javax.swing.JMenu mnTool;
    private javax.swing.JMenuItem mniAbout;
    private javax.swing.JMenuItem mniBackup;
    private javax.swing.JMenuItem mniChangePwd;
    private javax.swing.JMenuItem mniConfig;
    private javax.swing.JMenuItem mniDailyReport;
    private javax.swing.JMenuItem mniExit;
    private javax.swing.JMenuItem mniHelp;
    private javax.swing.JMenuItem mniLoaiKhachHang;
    private javax.swing.JMenuItem mniLoaiMatHang;
    private javax.swing.JMenuItem mniLogin;
    private javax.swing.JMenuItem mniLogout;
    private javax.swing.JMenuItem mniMatHang;
    private javax.swing.JMenuItem mniMonthlyReport;
    private javax.swing.JMenuItem mniNghanhHang;
    private javax.swing.JMenuItem mniPeriodReport;
    private javax.swing.JMenuItem mniQLKhachHang;
    private javax.swing.JMenuItem mniQLKho;
    private javax.swing.JMenuItem mniQLNhaCungCap;
    private javax.swing.JMenuItem mniQLNhanVien;
    private javax.swing.JMenuItem mniRestore;
    private javax.swing.JMenuItem mniSearch;
    private javax.swing.JMenuItem mnuCustomerList;
    private javax.swing.JMenuItem mnuEmployeeList;
    private javax.swing.JMenuItem mnuProductList;
    private javax.swing.JMenuItem mnuTypeList;
    private javax.swing.JMenuItem mnuVendorList;
    private javax.swing.JPanel pnlBanner;
    private javax.swing.JPanel pnlButtonBar;
    private javax.swing.JPanel pnlCenter;
    public javax.swing.JPanel pnlDualPane;
    public javax.swing.JPanel pnlLeft;
    public javax.swing.JPanel pnlMainPane;
    public javax.swing.JPanel pnlRight;
    public javax.swing.JPanel pnlSecondPane;
    private javax.swing.JPanel pnlStatus;
    private javax.swing.JPopupMenu.Separator sep1;
    private javax.swing.JPopupMenu.Separator sep2;
    // End of variables declaration//GEN-END:variables

    private void extraInitComponents() {
        Image icon = this.getToolkit().getImage(getClass().getResource("/com/viweb/storemanager/imgae/table.png"));
        this.setIconImage(icon.getScaledInstance(icon.getWidth(this), icon.getHeight(this), 0));
        this.mainPanel = new MyCafePnl();
        this.pnlRight.add(this.mainPanel);
        this.initRootWindow();
        this.initButtonBar();
        this.initStatusBar();
        this.backToHomeScreen();
    }

    private void backToHomeScreen() {
        this.setTitle(this.applicationTitle);
        this.pnlRight.removeAll();
        this.pnlRight.add(this.mainPanel);
        this.pnlRight.updateUI();
        this.btnBaocao.setSelected(true);
    }

    private void initRootWindow() {
        views[0] = new View("  Tra cứu", null, this.pnlLeft);
        views[0].getViewProperties().getViewTitleBarProperties().setVisible(false);
        viewMap.addView(0, views[0]);
        views[1] = new View("Main", null, this.pnlRight);
        views[1].getViewProperties().getViewTitleBarProperties().setVisible(false);
        viewMap.addView(1, views[1]);

        rootWindow = DockingUtil.createRootWindow(viewMap, true);
        properties.addSuperObject(currentTheme.getRootWindowProperties());
        properties.addSuperObject(titleBarStyleProperties);
        rootWindow.getRootWindowProperties().addSuperObject(properties);
        rootWindow.setWindow(new SplitWindow(true, 0.17F, views[0], views[1]));
        this.pnlCenter.add(rootWindow, java.awt.BorderLayout.CENTER);
    }

    //thêm nut truy cập nhanh cho ứng dụng
    private void initButtonBar() {
        ButtonBarFactory buttonBarFactory = new ButtonBarFactory("/com/viweb/storemanager/imgae/");

        btnCustomer = buttonBarFactory.addButton("Khách hàng", "customer-icon.png");
        btnCustomer.setOpaque(true);
        btnCustomer.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);

                setCustomApplicationTitle("Khách hàng");

                pnlMainPane.removeAll();
                CustomerPnl customerPnl = new CustomerPnl();
                pnlMainPane.add(customerPnl);
                pnlMainPane.updateUI();

                pnlSecondPane.removeAll();
                pnlSecondPane.add(customerPnl.getCreationPanel());
                pnlSecondPane.updateUI();

                pnlRight.removeAll();
                pnlRight.add(pnlDualPane);
                pnlRight.updateUI();

                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });

        btnProduct = buttonBarFactory.addButton("Mặt hàng", "icon_product.png");
        btnProduct.setOpaque(true);
        btnProduct.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);

                setCustomApplicationTitle("Mặt hàng");

                pnlMainPane.removeAll();
                ProductPnl productPnl = new ProductPnl();
                pnlMainPane.add(productPnl);
                pnlMainPane.updateUI();

                pnlSecondPane.removeAll();
                pnlSecondPane.add(productPnl.getCreationPanel());
                pnlSecondPane.updateUI();

                pnlRight.removeAll();
                pnlRight.add(pnlDualPane);
                pnlRight.updateUI();

                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });


        btnNhapHang = buttonBarFactory.addButton("Nhập hàng", "kmenuedit.png");
        btnNhapHang.setOpaque(true);
        btnNhapHang.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);

                setCustomApplicationTitle("Nhập hàng");

                pnlMainPane.removeAll();
                ShipinvoicePnl shipinvoicePnl = new ShipinvoicePnl();
                pnlMainPane.add(shipinvoicePnl);
                pnlMainPane.updateUI();

                pnlSecondPane.removeAll();
                pnlSecondPane.add(shipinvoicePnl.getCreationPanel());
                pnlSecondPane.updateUI();

                pnlRight.removeAll();
                pnlRight.add(pnlDualPane);
                pnlRight.updateUI();

                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });

        btnXuatHang = buttonBarFactory.addButton("Xuất hàng", "icon_shipping.png");
        btnXuatHang.setOpaque(true);
        btnXuatHang.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);

                setCustomApplicationTitle("Xuất hàng");

                pnlMainPane.removeAll();
                SaleinvoicePnl saleinvoicePnl = new SaleinvoicePnl();
                pnlMainPane.add(saleinvoicePnl);
                pnlMainPane.updateUI();

                pnlSecondPane.removeAll();
                pnlSecondPane.add(saleinvoicePnl.getCreationPanel());
                pnlSecondPane.updateUI();

                pnlRight.removeAll();
                pnlRight.add(pnlDualPane);
                pnlRight.updateUI();

                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });

        btnWareHouse = buttonBarFactory.addButton("Kho hàng", "code_warehouse_icon.png");
        btnWareHouse.setOpaque(true);
        btnWareHouse.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);

                setCustomApplicationTitle("Quản lý kho");
                WarehouseImportExportPnl warehouseImportExportPnl = new WarehouseImportExportPnl(MainFrm.this);
                pnlRight.removeAll();
                pnlRight.add(warehouseImportExportPnl);
                pnlRight.updateUI();

                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });

        btnBaocao = buttonBarFactory.addButton("Thống kê", "table_1.png");
        btnBaocao.setOpaque(true);
        btnBaocao.setSelected(true);
        btnBaocao.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CursorManager.setWaitCursor(MainFrm.this);
                setCustomApplicationTitle("Báo cáo ngày");
                DailyReportPnl dailyReportPnl = new DailyReportPnl();
                pnlRight.removeAll();
                pnlRight.add(dailyReportPnl);
                pnlRight.updateUI();
                CursorManager.setDefaultCursor(MainFrm.this);
            }
        });

        btnAbout = buttonBarFactory.addButton("Thông tin", "information_1.png");
        btnAbout.setOpaque(true);
        btnAbout.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                setTitle(applicationTitle);
                AboutDlg dialog = new AboutDlg(MainFrm.this, true);
                dialog.setSize(425, 337);
                dialog.setLocationRelativeTo(MainFrm.this);
                dialog.setVisible(true);
            }
        });

        JButtonBar buttonBar = buttonBarFactory.getButtonBar();
        buttonBar.setBorder(null);
        buttonBar.setBackground(this.pnlButtonBar.getBackground());
        this.pnlButtonBar.add(buttonBar);
    }

    private void initStatusBar() {
        this.statusBar = new AppStatusBar();
        this.pnlStatus.add(this.statusBar.getBar(), BorderLayout.CENTER);
    }

    private ImagePanel createBannerPanel() {
        try {
            Image image = new ImageIcon(getClass().getResource("/com/viweb/storemanager/imgae/banner.jpg")).getImage();
            ImagePanel banner = new ImagePanel(image);
            return banner;
        } catch (Exception ex) {
            return null;
        }
    }
}
